/**
 * Copyright (c) 2015-2018, Golly Hu 胡高 (3722711@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.hg.jfsa.web.service.api;

import java.util.List;
import java.util.Map;

import com.jfinal.plugin.activerecord.Page;

import cn.hg.jfsa.model.News;
import cn.hg.jfsa.model.NewsCategory;

/**
 * @author Golly
 */
public interface NewsServiceApi {

	/**
	 * 取得新闻
	 *
	 * @param id
	 *
	 * @return
	 */
	News getNews (int id);

	/**
	 * @param code
	 *
	 * @return
	 */
	List<NewsCategory> getNewsCategoryList (Map<String, Object> paraMap);

	/**
	 * 获取新闻
	 *
	 * @param index
	 *            页数
	 * @param size
	 *            条数
	 * @param categoryId
	 *            （可选）分类ID
	 * @param title
	 *            （可选）标题，模糊查询
	 * @param keyword
	 *            （可选）关键字，模糊查询
	 *
	 * @return 新闻Page对象
	 */
	Page<News> getNewsPage (int index, int size, Map<String, Object> paraMap);

	/**
	 * 取得下一个新闻
	 *
	 * @param id
	 *
	 * @return
	 */
	News getNextNews (int id, Map<String, Object> paraMap);

	/**
	 * 取得上一个新闻
	 *
	 * @param id
	 *
	 * @return
	 */
	News getPrevNews (int id, Map<String, Object> paraMap);

	/**
	 * 取得随机新闻列表
	 *
	 * @param paraMap
	 *
	 * @return
	 */
	List<News> getRandomNewsList (Map<String, Object> paraMap);

	/**
	 * 取得置顶新闻列表
	 *
	 * @param paraMap
	 *
	 * @return
	 */
	List<News> getTopNewsList (Map<String, Object> paraMap);

}
